package br.com.zonavibe.components
{
	import com.flexpernambuco.controls.MasterTextInput;

	import flash.events.Event;
	import flash.events.FocusEvent;
	import flash.events.MouseEvent;

	public class ZVTextInput extends MasterTextInput
	{

		public function ZVTextInput()
		{
			capsType=this.CAPS_UPPERCASE;
			blankMaskChar=" ";

			addEventListener(FocusEvent.FOCUS_IN, caretPosition);
			addEventListener(MouseEvent.CLICK, caretPosition);
		}

		private function caretPosition(event:Event):void
		{
			selectionBeginIndex=selectionEndIndex=Math.max(actualText.length, text.indexOf(blankMaskChar));
		}

	}
}
